const { ListToNode, NodeToList, ListNode, timeL } = require("../utils.js");
/**
 * @param {number[][]} matrix
 * @return {void} Do not return anything, modify matrix in-place instead.
 */
var rotate = function (matrix) {
  let arr = matrix.map((item) => {
    return [...item];
  });
  let leng = matrix.length;
  for (let i = 0; i < leng; i++) {
    for (let y = 0; y < leng; y++) {
      matrix[i][y] = arr[leng - y - 1][i];
    }
  }
  return matrix;
};
let matrix = [
  [1, 2, 3],
  [4, 5, 6],
  [7, 8, 9],
];
/**
7 4 1   0,0 0,l   0,1 1,l   0,2 2,l
8 5 2  l-x -> y   y -> x
9 6 3
 */

timeL(rotate, [matrix]);
